// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose:  File system utility function prototypes..
//   $Id$


#pragma once

#include <atlstr.h>

namespace xport
{
	// Read a file from the local file system.
	HRESULT ReadFromFileSystem(const TCHAR *lpszPath, void **ppContent, DWORD *pdwDataSize = 0);

	// Write data to the local file system [clobbers any existing file].
	HRESULT WriteToFileSystem(const TCHAR *lpszPath, const void *pContent, const DWORD dwDataSize);

	// Write two separate data blocks to the local file system [clobbers any existing file].
	HRESULT WriteToFileSystem(const TCHAR *lpszPath, const void *pContent1, const DWORD dwDataSize1, const void *pContent2, const DWORD dwDataSize2);

	// Create a directory structure on the local file system, based on a target file name. Must be a full [i.e. not relative] path. Recursive.
	HRESULT CreateDirectoryStructure(const TCHAR *lpszPath);

	// Return the home directory for the specified module handle.
	HRESULT GetHomeDirectory(HMODULE hModule, BSTR *psHomeDirectory);
	HRESULT GetHomeDirectory(HMODULE hModule, CString &sHomeDirectory);
}
